import config from '@/request/baseUrl.js';

// 上传图片
export const commonUpload = (filePath) => {
	const token = uni.getStorageSync('token')
	return new Promise((resolve) => {
		uni.uploadFile({
			url: config.baseUrl + '/api/index/upload',
			filePath: filePath,
			formData: null,
			header: {
				token: token
			},
			name: 'file',
			success: data => {
				let info = JSON.parse(data.data)
				resolve(info);
			}
		});
	})
}